package com.cwd.arm.infrastructure.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.cwd.arm.infrastructure.dao.AuthDao;
import com.cwd.arm.infrastructure.mapper.AuthMapper;
import com.cwd.arm.infrastructure.po.AuthPo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cwd.arm.infrastructure.query.AuthDaoQuery;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* Description:权限
* Created on 2021年11月16日
* @author  yan
*/
@Service
public class AuthDaoImpl extends ServiceImpl<AuthMapper, AuthPo> implements AuthDao {

    @Override
    public List<AuthPo> selectByUserId(Long userId) {
        return baseMapper.selectByUserId(userId);
    }

    @Override
    public List<AuthPo> selectByQuery(AuthDaoQuery daoQuery) {
        return baseMapper.selectByQuery(daoQuery);
    }

    @Override
    public List<AuthPo> selectByType(String type) {
        QueryWrapper<AuthPo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("auth_type",type);
        return list(queryWrapper);
    }
}
